package cn.com.bluemoon.daps.standard.api;

import cn.com.bluemoon.daps.common.annotation.FcApiFor;
import cn.com.bluemoon.daps.common.constant.ServiceNameConstants.DapsApiStandard;
import cn.com.bluemoon.daps.common.domain.PageVo;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.standard.api.factory.RemoteStandardFallbackFactory;
import cn.com.bluemoon.daps.standard.entity.DapStandardBasic;
import cn.com.bluemoon.daps.standard.vo.BasicStandardFormVo;
import cn.com.bluemoon.daps.standard.vo.StandardInfoVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.validation.Valid;

/**
 * biaozhun服务
 *
 * @author Jarod Kong
 */
@FeignClient(value = DapsApiStandard.SERVICE, fallbackFactory = RemoteStandardFallbackFactory.class)
@RequestMapping(DapsApiStandard.BASE_URI + DapsApiStandard.API_BASIC_STD)
@ApiIgnore
public interface RemoteStandardBasicService {
    @GetMapping("/getBasic/{id}")
    public ResultBean<DapStandardBasic> getBasic(@PathVariable("id") String id);

    @PostMapping("/list")
    @ApiOperation(value = "根据主题id和层级分类获取分类列表数据-用于分类列表中")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "ok", response = ResultBean.class)})
    public ResultBean getPublishBasicStd(@RequestBody @Valid BasicStandardFormVo<?> formVo);

    @GetMapping("/standard/basic/page")
    @ApiOperation("模糊查询基础标准信息")
    @FcApiFor(team = "数据资产团队")
    public ResultBean<PageVo<StandardInfoVo>> pageBasicStd(@RequestParam(value = "keyword", required = false) String keyword, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize);

    @GetMapping("/standard/index/page")
    @ApiOperation("模糊查询指标标准信息")
    @FcApiFor(team = "数据资产团队")
    public ResultBean<PageVo<StandardInfoVo>> pageIndexStd(@RequestParam(value = "keyword", required = false) String keyword, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize);
}
